//init state
export default {
    //localStorage
    cache: {
        key: 'tt_km',
        api: 'http://dev_cms_3.52tt.com/umbraco/api/ForumApi/', //数据接口地址
        auth: 'http://dev_cms_3.52tt.com/umbraco/api/Auth/', //注册，登录接口地址
    },

    //接口
    request: {
        /// <summary>
        /// 获取专栏列表
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="pageNumber">默认为0，表示第一页</param>
        /// <param name="pageSize">默认每页20条数据</param>
        /// <returns></returns>
        get_forum_list: 'GetForumList',

        /// <summary>
        /// 获取专栏内容
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="forum_id">专栏id</param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_forum_page: 'GetForumPage',

        /// <summary>
        /// 创建和更新专栏
        /// </summary>
        /// <param name="token">访问token</param>
        /// <param name="refreshToken">refresh token</param>
        /// <param name="uid">用户UID</param>
        /// <param name="id">专栏id，有则用于更新指定的专栏</param>
        /// <param name="name">专栏名称</param>
        /// <param name="intro">专栏简介</param>
        /// <param name="icon">专栏图标</param>
        /// <returns></returns>
        set_forum_content: 'PostForumContent',

        /// <summary>
        /// 获取文章内容
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="topic_id">文章id</param>
        /// <param name="uid">用户uid，会加入用户历史浏览记录</param>
        /// <returns></returns>
        get_topic_page: 'GetTopicPage',

        /// <summary>
        /// 创建和更新文章
        /// </summary>
        /// <param name="token">访问token</param>
        /// <param name="refreshToken">refresh token</param>
        /// <param name="uid">用户uid</param>
        /// <param name="id">文章id</param>
        /// <param name="forumId">专栏id</param>
        /// <param name="title">文章标题</param>
        /// <param name="content">内容</param>
        /// <param name="intro">简介，如果不传递，会根据内容创建简介</param>
        /// <param name="banner">头图</param>
        /// <returns></returns>
        set_topic_content: 'PostTopicContent',

        /// <summary>
        /// 创建和更新评论
        /// </summary>
        /// <param name="token">访问token</param>
        /// <param name="refreshToken">refresh token</param>
        /// <param name="uid">用户uid</param>
        /// <param name="content">评论内容</param>
        /// <param name="id">评论id，有则用于修改指定的评论（前端功能暂时不引入）</param>
        /// <param name="commentId">评论了哪条(commentId)评论</param>
        set_comments: 'PostTopicComments',

        /// <summary>
        /// 获取评论列表
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="topic_id">文章id</param>
        /// <param name="commentId">评论id，有则表示获取该回复下的所有评论</param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_comments: 'GetCommentList',

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <returns></returns>
        get_user_profile: 'GetUserProfile',

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="name">昵称</param>
        /// <param name="head">头像</param>
        /// <param name="comments">个性化签名</param>
        /// <param name="sex">性别</param>
        /// <returns></returns>
        set_user_profile: 'PostUserProfile',

        /// <summary>
        /// 根据关键词搜索
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="keywords">关键词</param>
        /// <param name="docType">表示搜索类型：1为用户，2为文章，4为概念</param>
        /// <param name="pageNumber">默认为0</param>
        /// <param name="pageSize">默认为20</param>
        /// <returns></returns>
        get_search_results: 'GetSearchResults',

        /// <summary>
        /// 获取用户关注内容
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid">用户id</param>
        /// <param name="docType">表示搜索类型：1为用户，4为概念，5为收藏夹，6为专栏</param>
        /// <param name="pageNumber">默认为0</param>
        /// <param name="pageSize">默认为20</param>
        /// <returns></returns>
        get_user_focus: 'GetUserFocus',

        /// <summary>
        /// 设置用户关注内容：专栏，作者，收藏夹，概念
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="userId">作者id</param>
        /// <param name="id">专栏，收藏夹，概念的id</param>
        /// <returns></returns>
        set_user_focus: 'PostUserFocus',

        /// <summary>
        /// 获取用户动态
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_actions: 'GetUserActions',

        /// <summary>
        /// 获取用户的文章列表
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_topic: 'GetUserTopic',

        /// <summary>
        /// 获取用户的收藏夹列表
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_favorites: 'GetUserFavorites',

        /// <summary>
        /// 创建和更新用户收藏夹
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="name">收藏夹的名称</param>
        /// <param name="id">收藏夹id，有则表示修改收藏夹名称</param>
        /// <param name="intro">收藏夹简介</param>
        /// <param name="icon">收藏夹自定义图标，前端功能暂时不开放</param>
        /// <returns></returns>
        set_user_favorites_folder: 'PostUpdateUserFavorites',

        /// <summary>
        /// 删除用户收藏夹
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="id">收藏夹id，有则表示修改收藏夹名称</param>
        /// <returns></returns>
        delete_user_favorites_folder: 'PostDeleteUserFavorites',

        /// <summary>
        /// 获取用户的收藏夹详情
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_favorites_detail: 'GetUserFavoritesDetail',

        /// <summary>
        /// 更新文章隶属的收藏夹列表
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="topicId">文章id</param>
        /// <param name="favorites">（Array）收藏夹列表数组，如果为null，表示不再收藏该文章</param>
        /// <returns></returns>
        set_topic_in_user_favorites: 'PostTopicInUserFavorites',

        /// <summary>
        /// 获取用户最近浏览
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_browsed: 'GetUserBrowsed',

        /// <summary>
        /// 获取用户草稿
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns>返回用户草稿列表，草稿表示未发布的文章</returns>
        get_user_draft: 'GetUserDraft',

        /// <summary>
        /// 赞文章和取消赞
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="liked">（bool）true or false，默认为true</param>
        /// <param name="uid"></param>
        /// <param name="topicId">文章id</param>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <returns></returns>
        set_topic_as_liked: 'GetTopicAsLiked',

        /// <summary>
        /// 创建和更新概念
        /// </summary>
        /// <param name="token"></param>
        /// <param name="refreshToken"></param>
        /// <param name="uid"></param>
        /// <param name="name">概念的名称</param>
        /// <param name="id">概念id，有则表示修改概念</param>
        /// <param name="intro">简介</param>
        /// <param name="icon">自定义图标</param>
        /// <returns></returns>
        set_concept_content: 'PostConceptContent',

        /// <summary>
        /// 获取用户感兴趣的内容（文章）
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_interest_content: 'GetInterestContent',

        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="account">账户</param>
        /// <param name="mail">邮件</param>
        /// <param name="name">昵称</param>
        /// <param name="pwd">密码</param>
        /// <param name="head">用户头像地址</param>
        /// <param name="phone">手机</param>
        /// <returns></returns>
        set_user_signup: 'PostUserSignup',

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="pwd">用户密码</param>
        /// <param name="account">账户名</param>
        /// <returns>用户信息和Token</returns>
        set_user_login: 'PostUserLogin',

        /// <summary>
        /// 获取用户消息列表
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        get_user_message_list: 'GetUserMessageList',

        /// <summary>
        /// 更新已读消息
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="uid"></param>
        /// <param name="messageId">消息id</param>
        /// <returns></returns>
        set_user_message_browsed: 'GetUpdateUserMessageBrowsed',

    },

    //当前位置
    current: {
        topicId: 0, //文章id
        forumId: 0, //专栏id
        commentsId: 0, //评论id
        pageName: '', //页名称
    },

    /// 1为用户，2为文章，3为评论，4为概念，5为收藏夹，6为专栏
    /// 基本数据类型的定义,用于综合查询接口,比如搜索
    docType: {
        Member: 1,
        Topic: 2,
        Comments: 3,
        Concepts: 4,
        Favorite: 5,
        Forum: 6,
    },

    //当前用户信息
    userProfile: {
        uid: 1067, //uid
        account: 'my_account', //账号
        name: '月小薇',
        sex: true, //true为女性
        head: 'http://app.52tt.com/api/face?cpid=1&uid=16640085&gid=1&account=tt3773119&ver=1', //头像
        comments: '御风小卫士', //个性签名
        concerned: 100, //多少人关注
        liked: 500, //获得多少次赞
        providerKey: '47eaf7b9-38d1-434f-974f-0ced3546d74b', //token
    },

    //作者
    users: {
        list: [{
            uid: 1067, //uid
            account: 'my_account', //账号
            name: '月小薇',
            sex: 1, //1为男性, 2为女性, 3为其他
            head: 'http://app.52tt.com/api/face?cpid=1&uid=16640085&gid=1&account=tt3773119&ver=1', //头像
            comments: '御风小卫士', //个性签名
            concerned: 100, //多少人关注
            liked: 500, //获得多少次赞
        },
            {
                uid: 1162, //uid
                account: 'my_account', //账号
                name: '昵称',
                sex: 1, //1为男性, 2为女性, 3为其他
                head: 'http://app.52tt.com/api/face?cpid=1&uid=16640085&gid=1&account=tt3773119&ver=1', //头像
                comments: '御风小卫士', //个性签名
                concerned: 1000, //多少人关注
                liked: 300, //获得多少次赞
            },
            {
                uid: 1163,
                account: 'my_account',
                name: 'WOWer',
                sex: 1,
                head: 'http://app.52tt.com/api/face?cpid=1&uid=16640085&gid=1&account=tt3773119&ver=1',
                comments: '御风小卫士',
                concerned: 100, //多少人关注
                liked: 200, //获得多少次赞
            }
        ]
    },

    //文章列表
    topic: {
        list: [{
            id: 1002, //文章id
            forumId: 1008, //专栏id
            title: 'Announcing Vue.js 2.0', //文章标题
            intro: '今天我们非常激动的首发', //内容摘要
            content: '今天我们非常激动的首发 Vue 2.0 preview 版本，这个版本带来了很多激动人心的改进和新特性。我们来看看这里面都有些什么！', //富文本内容
            type: 1, //1为玩家,2为官方,3为商业推广
            banner: 'http://zhitu.isux.us/assets/img/imgSample/test-60.jpg', //横幅图片
            liked: { //点赞列表
                list: [{
                    uid: 1162
                }],
                total: 10001 //该文章被点赞次数
            },
            comments: { //评论列表
                list: [{
                    id: 141414, //评论id
                    topicId: 114141, //文章id
                    forumId: 1515, //专栏id
                    content: '不好意思哈,只玩魔兽', //评论内容
                    createTime: 14741882873820, //创建时间
                    creator: { //评论者的信息
                        uid: 1163
                    },
                    reply: { //只用于评论了某人的评论, 这里是原始评论信息
                        id: 141414,
                        topicId: 114141,
                        forumId: 1515,
                        content: '王者荣耀可以吗',
                        createTime: 14741882873820,
                        creator: {
                            uid: 1162,
                        }
                    },
                    liked: 10 //评论被赞次数
                }

                ],
                total: 1, //该文章的评论总数
            },
            visitorStatus: { //当前用户的状态
                isLike: true, //是否点赞
                isComment: true, //是否评论
                isFavorites: true, //是否收藏
            },
            creator: {
                uid: 1162, //文章作者id
            },

            commentTime: 14741882873820, //最近的一次评论发布时间
            updateTime: 14741882873820, //更新时间
            createTime: 14741882873820, //创建时间
            serverTime: 14741882873820, //获取数据返回的服务器时间戳
            localTime: 14741882873820, //获取数据的本地时间戳
        }, ]

    },


    //专栏
    forum: {
        list: [{
            id: 1008,
            name: '移动端框架技术专栏', //专栏名称
            icon: '', //图标
            intro: '移动端框架技术讨论和知识沉淀', //简介
            concerned: 10000, //关注用户数
            posts: 100, //发帖数
            admin: [{
                uid: 500013,
            }],
            topic: { //文章列表
                list: [{
                    id: 1002 //文章id
                }, ],
                total: 1000 //服务器上此专栏的发帖数量
            },
            updateTime: 14741882873820, //最近更新
            createTime: 14741882873820, //创建时间
            serverTime: 14741882873820, //获取数据返回的服务器时间戳
            localTime: 14741882873820, //获取数据的本地时间戳
        }],
        total: 100
    },

    //概念
    concept: {
        list: [{
            id: 1100,
            name: 'Javascript', //概念
            icon: 'http://dev_cms_3.52tt.com/media/1036/javascript_p.jpg', //图标
            intro: '直译式脚本语言，是一种动态类型、弱类型、基于原型的语言，内置支持类型。它的解释器被称为JavaScript引擎，为浏览器的一部分，广泛用于客户端的脚本语言。', //简介
            concerned: 10000, //关注用户数

            creator: { //创建者的信息
                uid: 1603,
            },
            topic: {
                list: [{
                    id: 1002 //文章id
                }, ],
                total: 100 //服务器上此概念包含的文章数
            },

            updateTime: 14741882873820, //最近更新
            createTime: 14741882873820, //创建时间
            serverTime: 14741882873820, //获取数据返回的服务器时间戳
            localTime: 14741882873820, //获取数据的本地时间戳
        }]
    },


    //收藏夹
    favorites: {
        list: [{
            id: 1101,
            name: '我的收藏夹', //文件夹名称
            intro: 'HTML5 + CSS3', //简介
            concerned: 100, //关注用户数

            creator: { //创建者的信息
                uid: 1067,
            },
            topic: {
                list: [{
                    id: 1002 //文章id
                }, ],
                total: 100 //服务器上此收藏夹包含文章数
            },

            updateTime: 14741882873820, //最近更新
            createTime: 14741882873820, //创建时间
            serverTime: 14741882873820, //获取数据返回的服务器时间戳
            localTime: 14741882873820, //获取数据的本地时间戳
        }]
    },

    //消息
    message: {
        list: [{
            id: 1109,
            name: 'Message',
            intro: null,

            creator: { //创建者的信息
                uid: 1067,
            },
            topic: null, //文章的摘要内容，包括标题，简介等
            topicId: 3402, //文章id
            read: true, //消息是否已读
            action: 1, //1表示创建文章

            updateTime: 14741882873820, //最近更新
            createTime: 14741882873820, //创建时间
            serverTime: 14741882873820, //获取数据返回的服务器时间戳
            localTime: 14741882873820, //获取数据的本地时间戳
        }]
    }


}
